package com.lzj.demo.design.iterator.lcq;

import lombok.extern.slf4j.Slf4j;

@Slf4j
public class Test {
    public static void main(String[] args) {
        ChineseFoodMenu chineseFoodMenu = new ChineseFoodMenu();
        chineseFoodMenu.add("宫保鸡丁");
        chineseFoodMenu.add("孜然羊肉");
        chineseFoodMenu.add("水煮鱼");
        chineseFoodMenu.add("北京烤鸭");

        Iterator iterator = chineseFoodMenu.getIterator();
        while (iterator.hasNext()) {
            log.info("{}",iterator.next());
        }

        chineseFoodMenu.remove(1);

        Iterator iterator2 = chineseFoodMenu.getIterator();
        while (iterator2.hasNext()) {
            log.info("{}",iterator2.next());
        }
    }
}
